package com.xframe.domain.e3sp.basedata;

import com.xframe.domain.BaseModel;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.InputStream;

/**
 * @Description: 插图
 * @ClassName: com.xframe.domain.e3sp.basedata.PartImage
 * @Author: lmx
 * @CreateTime: 2024/01/04
 **/
@Data
@Accessors(chain=true)
@XTable(value = "p_t02_part_image", label = "插图")
@XSelectItem(keyName = "imageId",codeName = "imageNo",textName = "imageNo")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.basedata.Variety",foreignKey = "varietyId", targetKey = "varietyId",as = "refVariety")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.basedata.Section",foreignKey = "sectionId", targetKey = "sectionId",as = "refSection")

public class PartImage extends BaseModel {

    /**
     * 插图ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "image_id", primaryKeyFlag = true,desc = "插图ID")
    private Long imageId;

    /**
     * 插图号
     */
    @XQueryCondition
    @XColumn(name = "image_no", uniqueFlag = true,desc = "插图号",length = 100)
    @XGridTableRef
    private String imageNo;

    /**
     * 品种ID
     */
    @XQueryCondition
    @XColumn(name = "variety_id",desc = "品种ID")
    private Long varietyId;

    /**
     * 节号ID
     */
    @XQueryCondition
    @XColumn(name = "section_id",desc = "节号ID",length = 200)
    @XGridTableRef
    private Long sectionId;

    /**
     * 插图内容
     */
    @XColumn(name = "context",desc = "插图内容")
    private InputStream context;

    /**
     * 文件名
     */
    @XQueryCondition
    @XColumn(name = "name",desc = "文件名",length = 200)
    @XGridTableRef
    private String name;

    /**
     * 备注
     */
    @XColumn(name = "remark",desc = "备注",length = 500,nullFlag = true)
    private String remark;

    /**
     * 节排序码
     */
    @XColumn(name = "secyion_sort_no",desc = "节排序码",length = 200,nullFlag = true)
    private String secyionSortNo;

    /**
     * 排序码
     */
    @XColumn(name = "sort_no",desc = "排序码",length = 20,nullFlag = true)
    private String sortNo;

    /**
     * 所属品种
     */
    private Variety refVariety;

    /**
     * 所属节号
     */
    private Section refSection;
}
